﻿// <copyright file="SensorData.cs" company="Hallvard Korsgaard">
//  Microsoft Public License (Ms-PL). See license details here: http://enoceannet.codeplex.com/license
// </copyright>
// <author>Hallvard Korsgaard</author>

namespace ServiceContract
{
  using System;
  using System.Runtime.Serialization;

  /// <summary>
  /// Information about an EnOcean sensor.
  /// </summary>
  [DataContract(Namespace = "http://enoceannet.codeplex.com/EnOceanReceiver/v1")]
  public class SensorData
  {
    /// <summary>
    /// Gets or sets the 32 bit transmitter ID. The ID must be in the range 0 to 0xffffffff inclusive.
    /// </summary>
    [DataMember(IsRequired = true, Order = 0)]
    public long SensorId
    {
      get;
      set;
    }

    /// <summary>
    /// Gets or sets the time when the sensor triggered.
    /// </summary>
    [DataMember(IsRequired = true, Order = 1)]
    public DateTimeOffset Timestamp
    {
      get;
      set;
    }

    /// <summary>
    /// Gets or sets telegram. This is a 14 byte array. 
    /// </summary>
    [DataMember(IsRequired = true, Order = 2)]
    public byte[] EnOceanTelegram
    {
      get;
      set;
    }
  }
}
